package com.kgc.scd.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.kgc.scd.bean.Order;
import com.kgc.scd.bean.OrderExample;
import com.kgc.scd.mapper.OrderMapper;
import com.kgc.scd.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * Created On : 2022/6/15.
 * <p>
 * Author     : hi
 * <p>
 * Description: OrderServiceImpl
 */
@Slf4j
@Service
public class OrderServiceImpl implements OrderService {
    @Autowired(required = false)
    private OrderMapper orderMapper;
    /**
     *查询订单状态
     */
    @Override
    public Order inquireOrder(String orderId) {
        //OrderExample orderExample = new OrderExample();
        //OrderExample.Criteria criteria = orderExample.createCriteria();
        //criteria.andOrderIdEqualTo(orderId);
        QueryWrapper<Order> orderQueryWrapper = new QueryWrapper<>();
        orderQueryWrapper.eq("order_id",orderId);
        Order order = orderMapper.selectOne(orderQueryWrapper);
        return order;
        //return orderMapper.selectByExample(orderExample).get(0);
    }

}
